﻿<!DOCTYPE HTML>
<html>
{include file="public:header_css"}
<link href="__STATIC__/admin/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<style>
	input::-webkit-input-placeholder{
		color: #000000;
		font-weight: bold;
	}
	input::-moz-placeholder{   /* Mozilla Firefox 19+ */
		color: #000000;
		font-weight: bold;
	}
	input:-moz-placeholder{    /* Mozilla Firefox 4 to 18 */
		color: #000000;
		font-weight: bold;
	}
	input:-ms-input-placeholder{  /* Internet Explorer 10-11 */
		color: #000000;
		font-weight: bold;
	}
</style>
<body>

<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 商家管理 <span class="c-gray en">&gt;</span> 编辑商家
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>

<div class="page-container">

	<form action="" method="post" class="form form-horizontal" id="form-shops-add" enctype="multipart/form-data">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>商家名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.shop_name}" id="shop_name" name="shop_name" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>商家编号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.shop_no}" id="shop_no" disabled style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>可开门店数：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.can_open_store}" id="can_open_store" disabled name="can_open_store" style="width:60%;"> 个
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>法人姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.link_name}" id="link_name" name="link_name" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>联系电话：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.phone}" name="phone" id="phone" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>商家地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.shop_address}" name="shop_address" id="shop_address" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">有效期至：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text Wdate" id="validity_time" name="validity_time" value="{$info.validity_time|date='Y-m-d H:m:s',###}" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss' })" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.user_name}" id="user_name" disabled style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" placeholder="********" name="password" id="password" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>公众号名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.wx_name}" name="wx_name" id="wx_name" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>公众号账号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.wx_account}" name="wx_account" id="wx_account" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>原始ID：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.original}" name="original" id="original" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>AppId：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.appid}" name="appid" id="appid" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>AppSecret：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="{$info.appsecret}" name="appsecret" id="appsecret" style="width:60%;">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>公众号logo：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div  id="checkshow" style="width: 100px;height: 100px;padding: 5px;border: 1px solid #e6e6e6;border-radius: 10px;float:left;">
					<img src="{$info.wx_logo}" alt=""  id="ImgPreview" style="display: block;width: 100%;height: 100%"/>
				</div>
				<div style="float:left;margin: 80px 0 0 10px;">
					<button class="btn btn-primary radius" type="button"  onclick="$('#fileUpload').click()">选择图片</button>
					<span style="color:#c8a0a0;">建议上传图片尺寸 300*300</span>
				</div>
				<input type="file" class="input-text" id="fileUpload" name="pic" style="display: none">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                <a class="btn btn-warning radius" href="{:url('index')}">&nbsp;&nbsp;取消&nbsp;&nbsp;</a>
			</div>
		</div>
	</form>

</div>
{include file="public:footer_js"}

<script type="text/javascript" src="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        // 图片上传框
        $("#fileUpload").change(function() {
            $('#ImgPreview').show();
            var $file = $(this);
            var fileObj = $file[0];
            var windowURL = window.URL || window.webkitURL;
            var dataURL;
            var $img = $("#ImgPreview");
            if(fileObj && fileObj.files && fileObj.files[0]){
                dataURL = windowURL.createObjectURL(fileObj.files[0]);
                $img.attr('src',dataURL);
            }else{
                dataURL = $file.val();
                var imgObj = document.getElementById("ImgPreview");
                // 两个坑 : 1、在设置filter属性时，元素必须已经存在在DOM树中，动态创建的Node，也需要在设置属性前加入到DOM中，先设置属性在加入，无效；
                //        2、src属性需要像下面的方式添加，上面的两种方式添加，无效；
                imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                imgObj.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL;

            }
        });

    });
</script>

</body>
</html>